package Exercise;

import java.util.Arrays;
import java.util.Comparator;

public class LambdaExe1 {
    public static void main(String[] args) {
     String []arr={"a","aaAAA","AAAa","aaa"};

//        Arrays.sort(arr, new Comparator<String>() {
//            @Override
//            public int compare(String o1, String o2) {
//                return o1.length()-o2.length();
//            }
//        });

        //return 省略 类型省略 大括号分号省略
        Arrays.sort(arr, (o1,o2) ->  o1.length()-o2.length());

        System.out.println(Arrays.toString(arr));

    }

}
